package day008.homework;

import java.util.Random;
import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        Random r = new Random();
        int[] arr = new int[5];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(1, 101);
        }

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入1-100之间的一个整数：");
        int num = sc.nextInt();
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == num) {
                System.out.println("你输入的数字在数组中，并且索引为：" + i);
            }
        }
    }
}
